#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>

using namespace std;

int majorityElement(vector<int>& nums) {
    int cnt = 0, ret = 0;
    unordered_map<int, int> hash;

    for (auto& e : nums)
    {
        hash[e]++;
        if (hash[e] > cnt)
        {
            cnt = hash[e];
            ret = e;
        }
    }

    return  ret;
}

int main()
{

	return 0;
}